<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<title>阅学网欢迎您！</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta name="Keywords" content="">
	<meta name="description" content="">
	<jsp:include page="/user/common.jsp" />
	<script type="text/javascript" src="js/user/book/book.js"></script>
  </head>
<body>
<%--账号管理页面 --%>
<jsp:include page="/user/top.jsp"></jsp:include>
<jsp:include page="/user/resourcefile/resourceLeft.jsp"></jsp:include>
	<div style="float: left;width:980px;margin-top: 8px;margin-left: 30px;">
		<table class="table">
			<button type="button" class="btn btn-primary" id="upload-book">上传</button>
			  <thead>
			    <tr>
			      <th><input type="checkbox"></th>
			      			<th>书名</th>
							<th>时间</th>
							<th>浏览</th>
							<th>操作</th>
			      </tr>
			  </thead>
 			 <tbody>
  					<c:forEach items="${books }" var="book">
						<tr>
							<td><input type="checkbox"></td>
							<td>${book.bookName }</td>
							<td><fmt:formatDate value="${book.createDate}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></td>
							<td>${book.clickRate }</td>
							<%-- <td>
								<a  class="btn btn-warning" href="user/question/deleteQuestion?questionId=${book.id }">删除</a>
								<a  class="btn btn-info" href="user/question/toEditQuestion?questionId=${book.id }">编辑</a>
							</td> --%>
						</tr>
				</c:forEach>
  			</tbody>
		</table>
	</div>
	<div id="upload-book-div" class="upload-book-div" style="display:none;">
		<div class="upload-book-title">
			<span style="margin-top: -6px;float: left;">图书上传</span>
		</div>
		<div class="upload-book-form-div">
				<form action="user/book/saveBook" method="post" id="bookUpload" enctype="multipart/form-data">
		 		<table>
		 				<!-- <tr>
		 						<td class="upload-book-td">书名:</td>
		 						<td><input type="text" value="" name="bookName" id="bookName" class="form-control" /></td>
		 				</tr> -->
		 			<!-- 	<tr id="showImg">
		 						<td class="upload-book-td">缩略图:</td>
		 						<td><input type="file" name="file" id="img"/></td>
		 				</tr>	 -->
		 				<tr>
		 						<td class="upload-book-td">选择书籍:</td>
		 						<td><input type="file" name="bookPath" id="bookPath"/></td>
		 				</tr>	
		 					
		 				<tr>
		 						<td class="upload-book-td">相关描述:</td>
		 						<td><textarea rows="4" name="bookDescription" id="bookDescription" cols="70" class="form-control"></textarea></td>
		 				</tr>	
		 				</table>
					<div  class="upload-book-close">
						<button type="submit" class="btn btn-primary" id="book-upload-ok" onclick="javascript:uploadBook(); return false;" style="margin-right: 10px;">确定</button>
						<button type="button" class="btn btn-info" id="book-upload-cancel">取消</button>
					</div>
		 		</form>
				</div>
	</div>
	<div id="upload-book-bg" class="upload-book-bg" style="display:none;" ></div> 	
</body>
<script type="text/javascript">
	/* function showBookDiv(){
		document.getElementById("upload-book-div").style.display='block';
		document.getElementById("upload-book-bg").style.display='block';
	}
	 */
/* 	function hideBookDiv(){
		document.getElementById("upload-book-div").style.display='none';
		document.getElementById("upload-book-bg").style.display='none';
	} */
	
	
	/* function uploadBook(){
			var questionTitle = $('#questionTitle').val();
			var questionDetail = $('#questionDetail').val();
			if(questionTitle == '' || questionDetail == ''){
				alert('标题或者描述不能为空!');
				return;
			}
			document.getElementById("hideBookDiv").onsubmit();
	} */
</script>
</html>
